package com.bangdream.michelia.entity.courses;

import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.List;

/**
 * @date on 2018/8/1 21:19
 * @email 909732184@qq.com
 * 课程的实体类
 */
public class CoursesBean implements Parcelable {

    /**
     * id : 75f3d1b9a7fd469abc80f5c1ec623d44
     * createBy : 1
     * createTime : 2018-07-24 18:05:45
     * updateBy : 1
     * updateTime : 2018-07-30 13:40:31
     * delFlag : 0
     * orgId : a
     * createName : admin
     * name : 教你唱歌课程
     * faceUrl : http://inesa-test.oss-cn-shanghai.aliyuncs.com/byl/1532397793383937724.png
     * courseClassifiId : 9450ef95179941a384e678508143b870
     * publicState : 2
     * period : 271.0
     * isOrder : 1
     * status : 0
     * viewCount : 0
     * collectCount : 1
     * buyCount : 0
     * chapterCount : 1
     * pageNumber : 0
     * introduction : <p><span style="color:#CC0000">教你唱歌</span><span style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);">,从小白到会唱歌,专业老师独特教法,让</span><span style="color:#CC0000">唱歌</span><span style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px;background-color: rgb(255, 255, 255);">爱好者短期内学会</span><span style="color:#CC0000">唱歌</span><span style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);">.老师在线直播,免费学</span><span style="color:#CC0000">唱歌</span><span style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);">,</span><span style="color:#CC0000">教你</span><span style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);">快速上手</span></p>
     * isPushPlat : 2
     * chapterList : [{"id":"c10d15e499c947b7b18970f99818536b","createBy":"1","createTime":"2018-07-24 10:07:24","updateBy":"1","updateTime":"2018-07-24 10:07:24","delFlag":"0","orgId":"a","createName":"admin","courseId":"75f3d1b9a7fd469abc80f5c1ec623d44","name":"11","number":1,"allHour":15,"sourceList":[{"id":"5acfefab863b4038ae71d1f9d053dd7d","createBy":"1","createTime":"2018-07-24 10:07:24","updateBy":"1","updateTime":"2018-07-24 10:07:24","delFlag":"0","orgId":"a","createName":"admin","courseId":"75f3d1b9a7fd469abc80f5c1ec623d44","chapterId":"c10d15e499c947b7b18970f99818536b","sourceId":"9b57402b93694948bd1d4080bc5170b9"}]},{"id":"0b689471c30f45d4bec3df8f52b7673d","createBy":"1","createTime":"2018-07-24 10:07:24","updateBy":"1","updateTime":"2018-07-24 10:07:24","delFlag":"0","orgId":"a","createName":"admin","courseId":"75f3d1b9a7fd469abc80f5c1ec623d44","name":"唱歌","number":2,"allHour":256,"sourceList":[{"id":"1ce65e18dc85472097c4b935deb9091f","createBy":"1","createTime":"2018-07-24 10:07:24","updateBy":"1","updateTime":"2018-07-24 10:07:24","delFlag":"0","orgId":"a","createName":"admin","courseId":"75f3d1b9a7fd469abc80f5c1ec623d44","chapterId":"0b689471c30f45d4bec3df8f52b7673d","sourceId":"9e731d536ef3447db61ed9fd8bd20aa7"}]}]
     * teacherList : [{"id":"af47de42e46a4c6ba0434147f64a8c63","createBy":"1","createTime":"2018-07-24 10:07:24","updateBy":"1","updateTime":"2018-07-24 10:07:24","delFlag":"0","orgId":"a","createName":"admin","courseId":"75f3d1b9a7fd469abc80f5c1ec623d44","teacherId":"85500d90d7bd4211badd102e0a40e3c6","teacherName":"xiaoKTC"}]
     * coursePriceList : [{"id":"f0a208692b264c748b206d007bbcd0ae","createBy":"1","createTime":"2018-07-24 10:07:24","updateBy":"1","updateTime":"2018-07-24 10:07:24","delFlag":"0","orgId":"a","createName":"admin","courseId":"75f3d1b9a7fd469abc80f5c1ec623d44","price":0.02}]
     */

    private String id;
    private String courseId;
    private String createBy;
    private String createTime;
    private String updateBy;
    private String updateTime;
    private String delFlag;
    private String orgId;
    private String createName;
    private String name;
    private String faceUrl;
    private String courseClassifiId;
    private String publicState;
    private String title;
    private double period;
    private String isOrder;
    private String status;
    private String learnStatus;
    private String collectId;
    private int viewCount;
    private int learnCount;
    private int collectCount;
    private int buyCount;
    private int chapterCount;
    private int pageNumber;
    private String introduction;
    private String isPushPlat;
    private String deadline;
    //private boolean isCollect;
    //private boolean isBuy;
    private boolean collect;
    private boolean buy;
    private List<ChapterListBean> chapterList;
    private List<TeacherListBean> teacherList;
    private List<CoursePriceListBean> coursePriceList;

    protected CoursesBean(Parcel in) {
        id = in.readString();
        courseId = in.readString();
        createBy = in.readString();
        createTime = in.readString();
        updateBy = in.readString();
        updateTime = in.readString();
        delFlag = in.readString();
        orgId = in.readString();
        createName = in.readString();
        name = in.readString();
        faceUrl = in.readString();
        courseClassifiId = in.readString();
        publicState = in.readString();
        title = in.readString();
        period = in.readDouble();
        isOrder = in.readString();
        status = in.readString();
        learnStatus = in.readString();
        collectId = in.readString();
        viewCount = in.readInt();
        collectCount = in.readInt();
        buyCount = in.readInt();
        chapterCount = in.readInt();
        pageNumber = in.readInt();
        introduction = in.readString();
        isPushPlat = in.readString();
        deadline = in.readString();
        collect = in.readByte() != 0;
        buy = in.readByte() != 0;
        chapterList = in.createTypedArrayList(ChapterListBean.CREATOR);
        teacherList = in.createTypedArrayList(TeacherListBean.CREATOR);
        coursePriceList = in.createTypedArrayList(CoursePriceListBean.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(courseId);
        dest.writeString(createBy);
        dest.writeString(createTime);
        dest.writeString(updateBy);
        dest.writeString(updateTime);
        dest.writeString(delFlag);
        dest.writeString(orgId);
        dest.writeString(createName);
        dest.writeString(name);
        dest.writeString(faceUrl);
        dest.writeString(courseClassifiId);
        dest.writeString(publicState);
        dest.writeString(title);
        dest.writeDouble(period);
        dest.writeString(isOrder);
        dest.writeString(status);
        dest.writeString(learnStatus);
        dest.writeString(collectId);
        dest.writeInt(viewCount);
        dest.writeInt(collectCount);
        dest.writeInt(buyCount);
        dest.writeInt(chapterCount);
        dest.writeInt(pageNumber);
        dest.writeString(introduction);
        dest.writeString(isPushPlat);
        dest.writeString(deadline);
        dest.writeByte((byte) (collect ? 1 : 0));
        dest.writeByte((byte) (buy ? 1 : 0));
        dest.writeTypedList(chapterList);
        dest.writeTypedList(teacherList);
        dest.writeTypedList(coursePriceList);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<CoursesBean> CREATOR = new Creator<CoursesBean>() {
        @Override
        public CoursesBean createFromParcel(Parcel in) {
            return new CoursesBean(in);
        }

        @Override
        public CoursesBean[] newArray(int size) {
            return new CoursesBean[size];
        }
    };

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    public String getCollectId() {
        return collectId;
    }

    public void setCollectId(String collectId) {
        this.collectId = collectId;
    }

    public int getLearnCount() {
        return learnCount;
    }

    public void setLearnCount(int learnCount) {
        this.learnCount = learnCount;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFaceUrl() {
        return faceUrl;
    }

    public void setFaceUrl(String faceUrl) {
        this.faceUrl = faceUrl;
    }

    public String getCourseClassifiId() {
        return courseClassifiId;
    }

    public void setCourseClassifiId(String courseClassifiId) {
        this.courseClassifiId = courseClassifiId;
    }

    public String getPublicState() {
        return publicState;
    }

    public void setPublicState(String publicState) {
        this.publicState = publicState;
    }

    public double getPeriod() {
        return period;
    }

    public void setPeriod(double period) {
        this.period = period;
    }

    public String getIsOrder() {
        return isOrder;
    }

    public void setIsOrder(String isOrder) {
        this.isOrder = isOrder;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getLearnStatus() {
        return learnStatus;
    }

    public void setLearnStatus(String learnStatus) {
        this.learnStatus = learnStatus;
    }

    public int getViewCount() {
        return viewCount;
    }

    public void setViewCount(int viewCount) {
        this.viewCount = viewCount;
    }

    public int getCollectCount() {
        return collectCount;
    }

    public void setCollectCount(int collectCount) {
        this.collectCount = collectCount;
    }

    public int getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(int buyCount) {
        this.buyCount = buyCount;
    }

    public int getChapterCount() {
        return chapterCount;
    }

    public void setChapterCount(int chapterCount) {
        this.chapterCount = chapterCount;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public String getIsPushPlat() {
        return isPushPlat;
    }

    public void setIsPushPlat(String isPushPlat) {
        this.isPushPlat = isPushPlat;
    }

    public String getDeadline() {
        return deadline;
    }

    public void setDeadline(String deadline) {
        this.deadline = deadline;
    }

    public boolean isCollect() {
        return collect;
    }

    public void setCollect(boolean collect) {
        this.collect = collect;
    }

    public boolean isBuy() {
        return buy;
    }

    public void setBuy(boolean buy) {
        this.buy = buy;
    }

    public List<ChapterListBean> getChapterList() {
        return chapterList;
    }

    public void setChapterList(List<ChapterListBean> chapterList) {
        this.chapterList = chapterList;
    }

    public List<TeacherListBean> getTeacherList() {
        return teacherList;
    }

    public void setTeacherList(List<TeacherListBean> teacherList) {
        this.teacherList = teacherList;
    }

    public List<CoursePriceListBean> getCoursePriceList() {
        return coursePriceList;
    }

    public void setCoursePriceList(List<CoursePriceListBean> coursePriceList) {
        this.coursePriceList = coursePriceList;
    }

    public CoursesBean() {
    }

}
